home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / DDPLUS71.ZIP / DDPLUS.DOC < prev    next >
Text File  |  1995-05-14  |  84KB  |  1,841 lines

  1.         DDPLus Version 7.1 Door Driver Toolkit for Turbo Pascal 7.0
  2.      NOTE:  Items with marked with a "*" have changed since version 7.0
  3.  
  4.                                 DISCLAIMER
  5.                                 ----------
  6.  The contributors have taken every precaution to insure that no harm or
  7.  damage will occur on computer systems operating this package. Nevertheless,
  8.  they shall NOT be held liable for whatever may happen on your computer
  9.  system or to any computer systems which connects to your own as a result of
  10.  operating this package. The user assumes full responsibility for the correct
  11.  operation of this software package, whether harm or damage results from
  12.  software error, hardware malfunction, or operator error. NO warranties are
  13.  offered, expressly stated or implied, including without limitation or
  14.  restriction any warranties of operation for a particular purpose and/or
  15.  merchantability. If you do not agree with this then do NOT use DDPLUS.
  16.  
  17.  
  18.               COPYRIGHT INFORMATION ON DDPLus TOOLKIT (C)
  19.               ---------------------------------------------------
  20.  Most of the source code for the DDPlus package comes from the original Door
  21.  Driver Kit 5.0 and that code is copyrighted by Scott Baker and Derrick
  22.  Parkhurst. This copyright includes all source code and sample doors
  23.  originated by them. These authors have permitted the original code to be
  24.  published as Freeware, although they still retain copyrights to their
  25.  original material.  All other material, other then the original Scott
  26.  Baker/Derrick Parkhurst items, is Copyrighted by Steven Lorenz and Bob
  27.  Dalton. The IBBS.ZIP package is copyrighted by Andy Stewart. The
  28.  RIPLINK.ZIP package is copyrighted by Tom Morgan.  These authors are
  29.  solely responsible for the content of their portions of DDPlus, not to
  30.  mention any bugs <grin>.  
  31.         
  32.                              LICENSE AGREEMENT
  33.                              -----------------
  34.  The program source code, support files, and documentation NOT part of the
  35.  the original Door Driver Kit package are copyrighted products of Steven
  36.  Lorenz and Bob Dalton.  The IBBS.ZIP package is copyrighted by Andy Stewart.
  37.  These authors reserve all rights to these products. This is protected by
  38.  the United States of America (USA) and International Copyright Laws. You
  39.  may modify or use the the enclosed source code for your programs but you
  40.  may NOT distribute DDPLUS source code modifications as part of the DDPLUS
  41.  package. In cases where this may infringe on the Copyrights of the original
  42.  Door Driver Kit authors, then their Copyrights will take precedence.
  43.         
  44.  Tampering with or altering the contents or integrity of the DDPlus software
  45.  package is prohibited IF you intend to give a copy of the DDPLus archive
  46.  package to others. No fee may be charged by any agency beyond the cost of
  47.  distributing copies. The bottom line folks: Don't make any changes in this
  48.  package and redistribute as coming from us, and you can't re-label or modify
  49.  the DDPLUS package and market it as your own!
  50.  
  51.             WHAT'S IT GOING TO COST YOU TO USE THIS PACKAGE?
  52.             ------------------------------------------------                     
  53.  Nothing! The DDPlus package is distributed as FREEWARE and requires NO
  54.  registration and NO royalties for door products produced with this package.
  55.  It would be nice though if you credit the DDplus Door Kit in your program
  56.  with a line that says something like "Another DDPLus Door Program" or
  57.  something similar and in the documentation so that others will know it is
  58.  a product based on the DDPlus kit. The individual authors of this package
  59.  will NOT however turn down a registered copy of any program created with
  60.  this package, if it is offered to us in appreciation for all the work
  61.  involved <grin>. These will ALWAYS be gladly accepted! (Hey, we ARE
  62.  sysops as well as programmers after all!!)
  63.      
  64.                              INTRODUCTION:
  65.                              ------------
  66.  DDplus is a package of pascal units for use in creating programs for
  67.  use with Bulletin Board Systems (BBS).  These programs are called "DOORS"
  68.  and are stand alone products which "link" with the BBS to allow users
  69.  to enjoy games and utilities of all types.  The DDPlus package takes the
  70.  tedium out of Door programming by allowing you to concentrate on the
  71.  writing of door specific code and not having to worry about details such
  72.  working with fossils, multi-tasker support, handling communications I/O and
  73.  the processing of BBS drop Files. This package does NOT teach Turbo Pascal
  74.  programming. It assumes that you know basic Turbo Pascal programming
  75.  already, and desire to put that knowledge to use by designing a door for
  76.  a BBS.   
  77.  
  78.                     Features of DDPLUS and the DDPLus Kit:
  79.                     --------------------------------------
  80.  
  81.  1. IRQs 0-15 are supported.
  82.  
  83.  2. Comports 1-4 supported.
  84.  
  85.  3. Selectable Port Addresses.
  86.  
  87.  4. DesqView aware routines.
  88.  
  89.  5. Detects Rip.
  90.  
  91.  6. Fast and correct ansi color routines.
  92.  
  93.  7. Lock baud and comm baud rates to 115,200
  94.  
  95.  8. Built in Windows, WindowsNT and OS/2 time slice releasing.
  96.  
  97. *9. Fossil support to 115,200 using extended fossil calls.
  98.     Since release of 7.0 we have received the specifications on how to
  99.     set the baud rate for highspeed bnu fossils.  Now port speeds of
  100.     57,600 and 115,200 for both X00 and BNU can be handled by either
  101.     the FOSSIL or the XFOSSIL options.  Once again FOSSIL will initialize
  102.     the detected fossil to the port speed and XFOSSIL will accept the
  103.     fossil as-is with no initialization.
  104.  
  105. 10. Local video can be toggled off to save processing time in multitasking
  106.     windows or to give some user privacy when competing in game against the
  107.     sysop.
  108.  
  109. 11. Multiple control files can be accessed by a command line parm.
  110.  
  111. 12. Will work with OR without the presence of a fossil.
  112.  
  113. 13. ALL source code is provided and you can modify it to do whatever you need
  114.     it to do!  Just be sure to document your changes as new versions of
  115.     DDPLUS come out periodically and will not have your changes in them.
  116.     A better idea would be to make a separate add on unit for use with
  117.     the main DDPLUS units so that you do not have to edit the DDPlus
  118.     units each time a new DDPlus version comes out.
  119.                 
  120. 14. A Turbo Vision program skeleton is provided for use as a door
  121.     setup/configuration/editor program.
  122.                 
  123. 15. An Inter BBS Door unit is provided so you can make your door an
  124.     inter BBS one if you desire.
  125.  
  126. *18. DDSETUP.EXE is provided for distribution with your Door program to help
  127.     users configure the required CTL file for use with your door. It is
  128.     FREEWARE.
  129.  
  130. 19. A file/record locking unit is provided to allow you to design
  131.     multi-node/online multi-player games.
  132.  
  133. 20. An automatic overlay unit is included for making programs overlays to
  134.     conserve memory and automatically initializes them.
  135.  
  136. 21. RipLink is now provided so that you can build in a local display of
  137.     RIP graphics for a using sysop.
  138.  
  139.                              REQUIREMENTS:
  140.                              ------------
  141.  At this point in time the only requirements are that you must be using
  142.  Borland Turbo Pascal 7.0.  Most of the kit should also work with version
  143.  6.0 as well, but we no longer guarantee it.  If you use file locking and
  144.  sharing then users must be notified that SHARE is required to be loaded
  145.  prior to use. The same goes for ANSI.SYS as well if ANSI graphics are used.
  146.  
  147.                             Files Included
  148.                             --------------
  149.  Below is a listing of all files for the this Package. Feel free to give
  150.  out copies of the ENTIRE archive package but please make sure all the
  151.  files below are in that package:
  152.  
  153.  DVAWARE.ASM  - DDPlus support source code unit.
  154.  SLASYNC.ASM  - DDPlus support source code unit.
  155.  SAMPLE1.BAT  - A sample BAT file which runs a DDPlus game program from the
  156.                   game directory. Feel free to distribute these batch
  157.                   files with your DDPLus game package creations.
  158.  SAMPLE2.BAT  - A sample BAT file which runs a DDPlus game program from any 
  159.                   node directory. Feel free to distribute these batch
  160.                   files with your DDPLus game package creations.
  161.  SAMPLE3.BAT  - A sample BAT file identical to the one I use on my Single
  162.                   node WildCat Support BBS to run my DDPlus Games. Feel free
  163.                   to distribute these batch files with your DDPLus game
  164.                   package creations.
  165. *GAME.CTL     - Un-edited and heavily commented Control file for use with
  166.                  all doors produced with the DDplus package.  Provided
  167.                  mainly for information as DDSETUP.ZIP now provides a VGA
  168.                  setup program for inclusion with programs made with this
  169.                  package.
  170.  FILE_ID.DIZ  - Ascii Description File for BBS Sysops on DDPLUS71.ZIP
  171. *DDPLUS.DOC   - The file you are now reading.
  172. *HISTORY.DOC  - History file of changes made to the DDPlus package.
  173.  DVAWARE.OBJ  - DDPlus support unit (compiled)
  174.  SLASYNC.OBJ  - DDPLus support unit (compiled)
  175.  ASYNC2.PAS   - DDPlus support source code unit.
  176. *COMIO.PAS    - DDPlus support source code unit.
  177. *DDANSI2.PAS  - DDPlus support source code unit.
  178.  DDFOSSIL.PAS - DDPlus support source code unit.
  179. *DDIGI.PAS    - DDPlus support source code unit (Digiboard support)
  180. *DDOVR.PAS    - DDPLus support source code unit.
  181. *DDOVR2.PAS   - DDPlus support source code unit.
  182. *DDPLUS.PAS   - Main DDPlus source code unit. Needs to be compiled.
  183. *DDSCOTT.PAS  - DDPlus support source code unit.
  184.  BOOKS.TXT    - List of useful Borland Pascal reference books.
  185.  SWAG.TXT     - Information on a programmers best friend -SWAG!
  186.  ANSIMENU.ZIP - A ANSI Menu routine with example program and
  187.                  instruction file. A simple but effective way to
  188.                  add ansi menus to your door program. Includes a sample
  189.                  door, with source code, to demonstrate the use of the
  190.                  ansimenu unit.
  191. *DDSETUP.ZIP  - VGA Setup program for distribution with doors you
  192.                  make using the DDPlus Package.  Freeware.
  193.  ELOG.ZIP     - An error log unit with explanation text file for
  194.                  use in your door programs. Can make bug detection
  195.                  and extermination of the little critters much easier.
  196.                  I highly recommend that you use this unit in ALL your
  197.                  door programs!!!  Revised to make it much easier to
  198.                  install then before.
  199.  IBBS.ZIP     - An Inter-BBS unit which can be used with DDplus to make
  200.                  an Inter-BBS capable door program.
  201.  LOCKING.ZIP  - A unit for use with your program and DDPlus that will
  202.                  give you the capability to make a multi-node and online
  203.                  multi-user door program. Includes a fully operational
  204.                  sample door, with source code,  which demonstrates the
  205.                  principles involved in file/record locking.
  206.  MACROKEY.ZIP - A small and simple unit with instruction file to allow
  207.                  you to add macro-recording and play-back to your
  208.                  door programs.
  209.  OVERLAY.ZIP  - A sample overlay initialization unit. Can be used to
  210.                  automatically provide overlay support. Comes with a
  211.                  text file to help explain it's use.
  212. *RIPLINK.ZIP  - RipLink units to allow you to show RIP graphics on
  213.                  the sysops screen! Works with RIP 1.54.
  214.  SETUP.ZIP    - A Turbo Vision skeleton program you can make into a
  215.                  door setup/configuration/editor program.
  216. *SYSOP.ZIP    - Sample of documentation I use with my door programs, to
  217.                  include the all important SYSOP.DOC which explains how
  218.                  sysops should set up the program to work on their BBS.
  219.                  Feel free to modify these files for your door products
  220.                  and distribute it with YOUR DDPlus creations. All we ask
  221.                  is that you keep us in the credits section of the
  222.                  document file. Hey, it's only fair we get some credit....
  223.  
  224.                   Installation and Preparation for Use
  225.                   ------------------------------------
  226.  
  227.  1. Move this package to a temporary directory and "unzip".
  228.  
  229.  2. Use Turbo Pascal 7.0 to compile DDPLUS.PAS (or DDPLUSR.PAS, included
  230.     in RIPLINK.ZIP, if you plan to use RipLink in your door programs).
  231.  
  232.  3. AFTER compiling, move ALL files ending with the extension TPU or OBJ
  233.      to your Pascal units directory.
  234.  
  235.  4. That's all you have to do!  The package is now ready to use in your
  236.     door programs.
  237.  
  238.                          WHAT ARE DROP FILES?
  239.                          --------------------
  240.  When the BBS transfers control to a door program it provides a file,
  241.  called a "DROP FILE" to the door program which contains essential
  242.  information such as the users name, time remaining, com port, connect
  243.  speed, etc..  The format for this "DROP FILE" varies from BBS to BBS.
  244.  At this time the DDPlus Package supports the following drop file formats:
  245.  
  246.        DOORSYS - The DOOR.SYS format (Wildcat!,GAP,TAG, etc)
  247.       *DORINFO1 - Remote Access,others(uses DORINFO1.DEF**)
  248.        RBBS - Rbbs version 16.1+  (uses DORINFOx.DEF*)
  249.        QUICK - Quickbbs,Force,R.A. (uses DORINFOx.DEF**)
  250.        PCB14 - Pcboard version 14
  251.        PCB15 - Pcboard version 15
  252.        PHOENIX - Phoenix bbs (uses INFO.BBS)
  253.        SPITFIRE - Spitfires bbs (uses SFDOORS.DAT)
  254.        WWIV - WWIV bbs (uses CHAIN.TXT)
  255.        TRIBBS - TriBBS software (uses TRIBBS.SYS)
  256.        2AM - JUMPER.DAT
  257.  
  258. *  New BBS type DORINFO1 uses the dorinfo1.def for dropfile name.
  259.    PCBoard 12 and Callinfo support hereith ends. These two obsolete
  260.    dropfiles are no longer supported.
  261.  
  262.                       THE DOOR CONTROL FILE (CTL)
  263.                       ---------------------------
  264.  To run properly DDPlus requires configuration information from a control
  265.  (CTL) file.  For your use a GAME.CTL file is enclosed with this package.
  266.  The GAME.CTL file is unedited and heavily commented so that you might
  267.  understand what each line does.  Note that lines beginning with the ";"
  268.  character are NOT read by the DDPlus program unit.  This CTL file tells
  269.  the DDPlus portion of your program how to act, what drop file to use, etc.
  270.  It should be noted that a program produced with DDPlus will NOT function
  271.  without the presence of a CTL file.  The CTL file can be renamed, such
  272.  as GOC.CTL or RAW.CTL and is loaded and processed automatically when your
  273.  program calls "INITDOORDRIVER" (explained below).  It has been our 
  274.  experience that most problems experienced by users of doors made with
  275.  DDPlus are from improperly configured CTL files.  To help correct this
  276.  Steven Lorenz has created a standard CTL setup program which can be
  277.  distributed with your programs and is FREEWARE.  This setup program
  278.  (DDSETUP.ZIP) provides VGA and mouse support and is very professional
  279.  is appearance.  It is also suggested that you provide a copy of the
  280.  GAME.CTL file with your door packages for user information purposes and
  281.  as a backup in those rare cases where the CTL setup program does not
  282.  function correctly because of an odd system configuration.
  283.  
  284.                        Command Line Parameters
  285.                        -----------------------
  286.  DDPlus supports several parameters which may be specified on the command
  287.  line. These parameters are handled automatically when you call 
  288.  "INITDOORDRIVER".  An example would be if you wanted to run the GodFather
  289.  of Crime Door Game locally then you would type the Command Line
  290.  parameter:  GOC /L
  291.  The following is a list of DDPlus supported Command Line Parameters.  
  292.  
  293.       "/Bxxxxx"   This tells GAME.EXE to lock its baud rate at
  294.       xxxxx.  In order to get the most efficiency out of a high speed
  295.       error correcting modem (9600 baud or above), you may lock the baud
  296.       rate to a speed higher than what the caller is actually using.
  297.       By locking the baud to say 38,400, the modem can compress text data
  298.       that is being sent and achieve a baud rate much higher than the
  299.       actual transmission rate.
  300.       This will lock the baud rate at the same value for all nodes that
  301.       use this command line.  If you perfer a more selective way to lock
  302.       baud use 'LOCKBAUD' command in the GAME.CTL file.
  303.  
  304.       "/Cx"     (where x is 1..4) This specifies a comport number.
  305.       Some bbs software does not create door information files (dropfiles)
  306.       that contain the comport number.  If your bbs does have a comport
  307.       listed in the dropfile then there is no need for this parameter.
  308.       The default is comport 0, local mode.
  309.  
  310.       "/E" - Expanded Memory Specification If your machine has over one
  311.       megabyte of memory, then you may have some available.  GAME.EXE can
  312.       utilize EMS to improve game performance and reduce conventional
  313.       memory requirements.
  314.       This command will tell GAME.EXE   to use EMS memory to hold its
  315.       overlay buffer.  Otherwise disc area may be used to hold this buffer.
  316.       This needs a memory manager and when enabled and is compatible with
  317.       DESQview.  Default is NOT to use any available EMS.
  318.  
  319.      *Some authors want to have their door run maintenance.  The
  320.       maintenance mode now is set and does not access a dropfile.  But
  321.       the author must still check for bbs_software=0 to flag this as a
  322.       maintenance run.
  323.  
  324.      *"/F"      This is a generic maintenance mode. It logs
  325.       into the game with the name "SYSTEM MAINTENANCE" in local mode.
  326.       You can use it if your program requires a nightly maintenance
  327.       or something similar.
  328.  
  329.      *"/H"      This is a generic maintenance mode. It logs
  330.       into the game with the name "SYSTEM MAINTENANCE" in local mode.
  331.       You can use it if your program requires a nightly maintenance
  332.       or something similar.
  333.  
  334.      *It is left to the programmer now to either block these options
  335.       or to use them to actually do something when switched.
  336.  
  337.       "/L"      This tells GAME.EXE to load up in LOCAL mode.
  338.       This is good for testing or when a sysop just wants to "try out" the
  339.       door without messing with his BBS setup.  The "/L" mode will ask the
  340.       user for his name and run the door in local mode.
  341.  
  342.       "/Nx"     (where x is 1..9) This specifies a "node number".
  343.       Some bbs software support multinode environments in which you must
  344.       know the node number of the drop file to use. For example, RBBS-PC
  345.       uses DORINFOx.DEF. If you specified "/N2" then GAME.EXE would use
  346.       DORINFO2.DEF.
  347.  
  348.       "/Mx"     (where x is up to 2 filename acceptable characters)
  349.       Used to specify one of Multiple control files.  If you have created
  350.       more than one GAME.CTL file (GAME1.CTL, GAME2.CTL, etc.) for each
  351.       node or network PC then you can select the one you want by using
  352.       the /M parm.
  353.       Example:  "/M2" will force GAME.EXE to use GAME2.ctl.
  354.  
  355.       "/Pyyy"   This specifies the path to the drop files.
  356.       For example, "/PC:\WILDCAT\WCWORK\NODE1" would tell GAME.EXE to
  357.       look for the drop file in C:\WILDCAT\WCWORK\NODE1. If this is left
  358.       out the program assumes the drop file is local.
  359.  
  360.       "/R"    Forces local RIP, if supported by the Door Program. Use
  361.       AFTER the "/L" parameter if running the door locally. Use this
  362.       with Doors which have RipLink built in to them to force display
  363.       of RIP on the sysops screen.  Default is No Local RIP otherwise.
  364.       
  365.       "/V"    This command will tell GAME.EXE not to show any display
  366.       on the local screen.  Only a colored screen and a message will be
  367.       displayed.  The cursor will not move as it will be turned off.
  368.       Saves a little processing on multi-tasking systems.
  369.  
  370.       "/W"      This flags the program that a network is present even
  371.       though no multitaskers are detected.  This is useful if the door is
  372.       run on a network such as Novell that doesn't use multitaskers.
  373.  
  374.                        Special Note on RIP Support
  375.                        ---------------------------
  376.  DDplus can detect if RIP is present but YOU must program in any code to
  377.  make use of RIP.  The extent of RIP support is to provide for both
  378.  detection AND to pass a variable which tells your program that the
  379.  door user has RIP.  RipLink is also provided to enable your RIP commands
  380.  (Version 1.54 or below) to be displayed on the sysops local screen.
  381.  
  382.                    Special Note on Multi-Tasker Support
  383.                    ------------------------------------
  384.  DDplus can detect the presence of DesqView, OS2, Windows 3.1, and Windows
  385.  NT and provide automatic time slice releasing to them. All with only
  386.  minimal coding required on your part.
  387. *Detect multi-taskers now check for OS/2 first then other taskers.
  388. *We have added int $28 to the Os/2 timeslicer.  This gives up the time
  389.  slice as well as idles dos while waiting for character input per any
  390.  Int $21 call.
  391.  
  392.  --------------------------------------------------------------------------
  393.  SPECIAL NOTE:  The following sections are from the original door driver
  394.  documentation from Scott Baker and have been changed and added to in 
  395.  order to allow them to be consistent with the the updates reflected in
  396.  the DDPlus package.
  397.  --------------------------------------------------------------------------
  398.  
  399.                        Overview of DDPlus Routines
  400.                        ---------------------------
  401.  The procedures, functions, and variables in DDPLus usually fall in one
  402.  of the following categories:
  403.  
  404.               * INPUT [INP]
  405.  
  406.                         Get information from the user who is online.
  407.                         Example: SREAD() which performs the
  408.                         functional equivelant of READLN().
  409.  
  410.               * OUTPUT [OUT]
  411.  
  412.                         Send information to the user. Example:
  413.                         SWRITE() which performs the equivelant of
  414.                         WRITE().
  415.  
  416.               * INFORMATIONAL [INF]
  417.  
  418.                         Provide information about the user, such as
  419.                         his name, baud rate, etc. Example:
  420.                         USER_FIRST_NAME which stores the current
  421.                         user's first name.
  422.  
  423.                         Informational variables are usually
  424.                         read-only, but some can be written to as
  425.                         well. Use common sense and you should get
  426.                         by.
  427.  
  428.               * CONTROL [CTL]
  429.  
  430.                         Procedures which perform various control
  431.                         functions over how DDPLUS operates.
  432.  
  433.  In the sections to follow, all functions/procedures/etc will be placed in
  434.  one of these categories for ease of use and easy identification.
  435.  
  436.                          Reference - Procedures
  437.                          ----------------------
  438.  
  439.           INITDOORDRIVER(filen: string);                   [CTL]
  440.  
  441.               This procedure MUST be called before any of
  442.           DDPlus's features are used. In fact, in most cases it
  443.           should be the first statement that your program executes.
  444.           The FILEN variable specifies the filename of the control
  445.           file that DDPlus will use (i.e. GAME.CTL).
  446.               InitDoorDriver does a variety of things including
  447.           loading and processing the control file, reading the drop
  448.           files, setting up serial I/O. It also sets up an "EXIT
  449.           Procuedure" which will automatically close down the serial
  450.           I/O when your program is finished.
  451.  
  452.           DISPLAYFILE(Filen: String);                      [OUT]
  453.  
  454.                This Procedure is usefull in that it will transfer an
  455.           Ascii or Ansi file, and will put "(C)ontinue, (S)top,
  456.           (N)onstop" to stop an Ascii file from scrolling of the
  457.           page and thus allowing the user to read this file at his
  458.           or her own speed.
  459.  
  460. ->        RELEASETIMESLICE                                 [OUT] 
  461.               This is automatically done while DDPlus is doing any of 
  462.           the Sread procedures.  It is also done whenever the commands
  463.           NetUnLock or NetClose are used from the NETFILEP.PAS unit.
  464.           It is included here so that if you have coded a procedure
  465.           which takes an abnormally long time to execute or complete you
  466.           SHOULD add this procedure call from DDPlus to your procedure
  467.           to give up a time slice to any resident multi-taskers which
  468.           might be present.
  469.           
  470.  ->       PROPELLER(V:Byte);                               [OUT]
  471.               This procedure provides a flashing/moving "propeller"
  472.           character on screen for as long as you call this procedure
  473.           by using a loop. This can be used to show a door user that
  474.           something is happening, processing, etc..instead of just a
  475.           blank screen or nothing.  The propeller itself only writes
  476.           and you must change the value of "V" to get the moving
  477.           affect.  Here is some sample code which you can use which
  478.           will show the proper propeller affect we are trying to obtain:
  479.  
  480.                Example of code which would make use of it:
  481.  
  482.                  Function  SpeedChar: Char;
  483.                  var
  484.                   Ch: Char;
  485.                  begin
  486.                   SpeedRead(ch);
  487.                   SpeedChar := Upcase(ch);
  488.                  end;
  489.  
  490.                  { This is a propeller prompt procedure }
  491.  
  492.                  Procedure TimeReadLoop (var cx:char;var TimesUP : boolean);
  493.                  var
  494.                   t : integer;
  495.                   ch : char;
  496.                   v  : byte;
  497.                  begin
  498.                   TimesUP := false;
  499.                   t := 0;
  500.                   v := 0;
  501.                   cx := #0;
  502.                   repeat
  503.                    inc(t);
  504.                    if t > 1500 then
  505.                     begin
  506.                      t := 0;
  507.                      inc(v);
  508.                      if v > 22 then
  509.                      v := 0;
  510.                      If v < 17 then
  511.                      case graphics of
  512.                       3 : Propeller(v);
  513.                  {    5 : not installed yet }
  514.                      end;
  515.                  {    If TimingYes then   } { Timed entry check    }
  516.                  {    CheckTime(TimesUP); } {                      }
  517.                     end;
  518.                    ch := SpeedChar;
  519.                    If ch <> #0 then cx := ch;
  520.                   until (cx <>#0 ) or TimesUP;
  521.                   case cx of
  522.                   '0'..'9',
  523.                   'A'..'Z' : Swritec(cx);
  524.                    else
  525.                     SwriteC(chr(250));
  526.                   end;
  527.                   ReleaseTimeSlice;
  528.                  end;
  529.  
  530.                                           
  531.           PROMPT(var s: string; length: integer; hi: boolean); [INP]
  532.  
  533.                The prompt procedure is a high-level string input
  534.           routine. It allows you to specify the maximum length of
  535.           the input string and if HI is set to true, it will hilight
  536.           the input in reverse background. The colors for the prompt
  537.           routine are defined in the control file.
  538.  
  539.           SCLRSCR;    { ANSI code }                        [OUT]
  540.  
  541.                This procedure clears the remote side's and the local
  542.           side's screen.
  543.  
  544.           SCRLEOL;                                         [OUT]
  545.  
  546.                This procedure will clear up to then end of the
  547.           current line. (note: only works when caller has ANSI
  548.           capabilities)
  549.  
  550.  
  551.           SET_FOREGROUND(b: byte); {chg SRL to byte }      [OUT]
  552.  
  553.                The set_foreground procedure sets the current
  554.           foreground color to the one specified by the byte
  555.           variable, b. The color is set both on the local side and
  556.           the remote side if the remote user has ANSI toggled on.
  557.           The acceptable range for the color is 0-31. Colors 0-15
  558.           are standard foreground colors and 16-31 represent colors
  559.           0-15 but in blinking mode.
  560.  
  561.           SET_COLOR(f,b: byte);  {by S. Lorenz }        [OUT]
  562.  
  563.                The set_color procedure sets the current foreground
  564.           color and background and are specified by the variable
  565.           bytes f and b. The color is set both on the local side and
  566.           the remote terminal if the remote user has toggled his
  567.           ANSI on. The acceptable range for the f is 0-31 and b is
  568.           0-7.  If the color is currently set to foreground or back-
  569.           ground then that process is skipped.  If a (7,0) is sent
  570.           then an ansi reset color code is sent.
  571.  
  572.           SET_BACKGROUND(b: byte);  {chg SRL to byte }     [OUT]
  573.  
  574.                The set_background procedure sets the current
  575.           background color to the one specified by the byte
  576.           variable, b. The color is set both on the local side and
  577.           the remote terminal if the remote user has toggled his
  578.           ANSI on. The acceptable range for the color is 0-7.
  579.  
  580.  
  581.           SGOTO_XY(x,y: integer);                          [OUT]
  582.  
  583.                Sgoto_xy allows you to position the cursor on the
  584.           local and remote screen. The valid range for X is 1 to 80
  585.           and the valid range for Y is 1 to 24.
  586.  
  587.           SREAD_CHAR(var c: char);                         [INP]
  588.  
  589.                This procedure waits for a character to be pressed
  590.           and then returns that character in the character variable.
  591.           No echoing is performed (i.e. the user will not see the
  592.           key he pressed). If you wish echoing, you must again write
  593.           the character with SWRITE below. This routine is useful
  594.           for writing your own lowlevel readln routines or
  595.           performing "hot-key" operations. It is a direct
  596.           replacement for CH:=READKEY.
  597.  
  598.           SREAD(var s: string);                            [INP]
  599.  
  600.                The sread procedure accomplishes the equivilant of
  601.           the Turbo Pascal procedure READLN. A string is read from
  602.           the user and wher the CR character is obtained, the
  603.           procedure exits with the string stored in the string
  604.           variable, s.
  605.  
  606.           SREAD_NUM(var i: integer);                       [INP]
  607.  
  608.                The sread_num procedure is almost identical to the
  609.           sread procedure except it will read an integer variable
  610.           instead of a string. Only the characters 0-9 are allowed
  611.           to be entered by the user. The value returned will be in
  612.           the range of -32768 to +32768.
  613.  
  614.  
  615.           SREAD_NUM_BYTE(var b: byte);                     [INP]
  616.  
  617.                The sread_num_byte procedure is almost identical to
  618.           the sread procedure except it will read an byte variable
  619.           instead of a string. Only the characters 0-9 are allowed
  620.           to be entered by the user. The value returned will be in
  621.           the range of 0 to 255.
  622.  
  623.  
  624.           SREAD_NUM_WORD(var w: word);                     [INP]
  625.  
  626.                The sread_num_word procedure is almost identical to
  627.           the sread procedure except it will read an word variable
  628.           instead of a string. Only the characters 0-9 are allowed
  629.           to be entered by the user. The value returned will be in
  630.           the range of 0 to 65535.
  631.  
  632.  
  633.           SREAD_NUM_LONGINT(var l: longint);               [INP]
  634.  
  635.                The sread_num_longint procedure is almost identical
  636.           to the sread procedure except it will read an longint
  637.           variable instead of a string. Only the characters 0-9 are
  638.           allowed to be entered by the user. The value returned will
  639.           be in the range of -2147483648 to +2147483647.
  640.  
  641.           SWRITE(s: string);                               [OUT]
  642.  
  643.                The swrite procedure is the equivilant of the Turbo
  644.           Pascal WRITE procedure. Swrite will simultaniously write
  645.           to both the local screen and the remote terminal. No CR/LF
  646.           sequence is added to the end of the string. (note: You may
  647.           also use WRITE(SOUTPUT,s))
  648.  
  649.  
  650.   ->      SWRITEXY(x,y: integer; s: string);                     [OUT]
  651.  
  652.                The swritexy procedure is the equivilant of the Turbo
  653.           Pascal GOTOXY followed with a WRITE procedure. SwriteXY will
  654.           goto to the screen position x,y and then simultaniously write
  655.           to both the local screen and the remote terminal. No CR/LF
  656.           sequence is added to the end of the string.
  657.  
  658.   ->       SWRITEC(ch: char);                                     [OUT]
  659.  
  660.                The swritec procedure is like a swrite but only a single
  661.           character is written to both the local and remote terminal.
  662.  
  663.  
  664.   ->      SELECTANSI(ch:Char, A:String);                   [OUT]
  665.  
  666.            Are you are tired of having lots of individual ANSI files
  667.             cluttering up the program directory?  If you are then
  668.             why not build an ANSI Resource file which contains ALL
  669.             the ANSI files in ONE file?  This command is called from
  670.             your own program and the pulls out a selected ansi screen
  671.             and displays it. This command is new to DDPlus 7.0.
  672.             Use it in your own program as follows:
  673.             
  674.             Procedure ShowAnsiMenu(ch:char, A:String);
  675.  
  676.              Procedure ShowAnsiMenu;
  677.               begin
  678.                ch:=1;
  679.                A:=MENU\MENU01.ANS';
  680.                SelectAnsi(ch, A);
  681.               end;
  682.  
  683.             Note - this procedure call goes into your unit calling
  684.              DDplus.  So you can just say ShowAnsiMenu('1') and show
  685.              the first ansi menu.  You can use any  character like 'a', 
  686.              'X' or anything you can think of.  Use a separate char for
  687.              each ansi screen that you put together and add to the
  688.              resource file. The second variable is a string showing
  689.              the path and file name to that ansi resource file.
  690.  
  691.             The following is an explanation of what must be done to 
  692.              make the actual ANSI resource file so this can work.
  693.  
  694.             I did my ansi scenes in Thedraw and saved them at a length
  695.               of 200. I then took them into the TP editor and appended
  696.               them to the end of  each other.  As I did this I inserted
  697.               the selecting character at the front of each line.  For
  698.               each new ansi file use a different character. Then save
  699.               this file, I call mine menu01.ans.  All these files must
  700.               be static, they can't be changable.  Use the normal
  701.               Displayfile for those things like ansi bulletins and other
  702.               things that you might change.
  703.           
  704.           SWRITELN(s: string);                             [OUT]
  705.  
  706.                The swriteln procedure is the equivilant of the Turbo
  707.           Pascal WRITELN procedure. Swrite will simultaniously write
  708.           to both the local screen and the remote terminal. A CR/LF
  709.           sequence is appended to the end of the string. (note: You
  710.           may also use WRITELN(SOUTPUT,s))
  711.  
  712.           DDASSIGNSOUTPUT(f: text);                        [CTL]
  713.  
  714.                This procedure assigns the simultanious output
  715.           channel to a text file. This is done automatically by
  716.           INITDOORDRIVER to SOUTPUT (i.e. DDASSIGNSOUTPUT(SOUTPUT).
  717.           But, if you wish to assign it to a different file, you may
  718.           do it with this procedure. For example:
  719.  
  720.           DDASSIGNSOUTPUT(my_output_file);
  721.           rewrite(my_output_file);
  722.           writeln(my_output_file,'This will go to both local and '+
  723.                                   'remote.');
  724.  
  725.                           Reference - Functions
  726.                           ---------------------
  727.  
  728.           SKEYPRESSED: Boolean;                            [INF]
  729.  
  730.                SKEYPRESSED will return TRUE if a key has been
  731.           pressed and is waiting to be read and FALSE if no key has
  732.           been pressed. It is the equivelant of Turbo Pascal's
  733.           KEYPRESSED function.
  734.                This also allows the program to pause until the user
  735.           presses a key. When used in a loop like this it stops
  736.           everything until user input occurs.
  737.  
  738.                Repeat Until skeypressed;
  739.  
  740.  
  741.           TIME_LEFT: Byte;                                 [INF]
  742.  
  743.                The time_left function returns the amount of time
  744.           left in minutes. This time is computed automatically by
  745.           DDPLUS for you.
  746.  
  747.                         USE OF FUNCTION KEYS               [OUT]
  748.                         --------------------
  749.                         
  750. ->       The following function keys have been defined in DDPlus
  751.          for use by Sysops:
  752.          
  753.          F1 = Display available "F" Keys and what they do.
  754.          F2 = Open a scrolling chat window with the door user.
  755.          F7 = Increments user time by 5 minutes.
  756.          F8 = Decrements user time by 5 minutes.
  757.         F10 = Ejects user from door and returns him/her to BBS after
  758.                showing a brief message.
  759.  
  760.          Of the above only the Chat command needs further explanation.
  761.          When the sysop hits the F2 key a scrolling chat window will
  762.          be opened in the users current screen display.  When terminated
  763.          it is up to your code to refresh the screen image on both ends.
  764.          To help you out in this, the Chat Command has been set to return
  765.          a "#3" character value to your program.  The way to use this
  766.          would be to include "#3" as a case statement choice set to
  767.          execute a current image refresh in your program.  
  768.  
  769.          Example code snippet:
  770.     
  771.           REPEAT
  772.            CP(3,18);W('Enter Selection: ');{Tells user to make choice}
  773.            REPEAT
  774.             XX:=UPCASE(GetChar)            {Waits for typed character}
  775.            UNTIL XX IN ['A','B','C','#3']; {List of available choices}
  776.            CASE XX OF
  777.            'B': BuyCop(Player);            {Call to game procedure}
  778.            'C': BuyDetective(Player);      {Call to game procedure}
  779.            '#3':RefreshCurrentScreen;      {Call to refresh procedure}
  780.           UNTIL XX IN ['A'];               {"A"=quit}
  781.  
  782.                         Reference - Variables
  783.                         ---------------------
  784.           SOUTPUT: text;                                   [OUT]
  785.  
  786.                This text file is associated with the simultanious
  787.           output channel. It provides an alternate form of IO than
  788.           using swrite/swriteln. To use, simply treat SOUTPUT as it
  789.           were a normal text file. For example,
  790.  
  791.             Writeln(SOUTPUT,'This is a test'); is the same as
  792.           swriteln('This is a test');
  793.  
  794.             When is this useful? When you want to use WRITELN's
  795.           ability to write various data types (i.e. integers, reals,
  796.           etc) or it's ability to format output. For example:
  797.  
  798.             USING SWRITELN: str(integer_data,tempstr);
  799.           swriteln(tempstr);
  800.  
  801.             USING SOUTPUT:  writeln(soutput,integer_data);
  802.  
  803.           ANSION: boolean;                                 [CTL]
  804.  
  805.               This variable controls whether local output (it has
  806.           nothing to do with remote) will go directly to the local
  807.           screen or if it will be sent through DDPLUS's
  808.           emulation routine. Since the emulation routine is slow in
  809.           comparison to direct output, this variable is defaulted to
  810.           FALSE. If you want to send your own ANSI codes to the
  811.           screen through SWRITE/SWRITELN, then you will have to set
  812.           this variable to TRUE.
  813.  
  814.           BAUD_RATE: integer;                              [INF]
  815.  
  816.                This variable holds the user's current baud rate.
  817.  
  818.           BBS_SOFTWARE: byte;                              [INF]
  819.  
  820.               The following numbers indicate software names:
  821.  
  822.           Number     Supported BBS                   DropFile Format
  823.           ------     ------------------------        --------------
  824.             1        Local Only Operation            N/A
  825.             3        QUICK                           DORINFOx.DEF
  826.             5        WWIV                            CHAIN.TXT
  827.             6        PC BOARD Vers 15                PCBOARD.SYS
  828.             7        RBBS 16.1                       DORINFOx.DEF
  829.             8        PHOENIX                         INFO.BBS
  830.           * 9        DORINFO1                        dorinfo1.def
  831.            10        PC BOARD Vers 14                PCBOARD.SYS
  832.            11        DOOR system format              DOOR.SYS
  833.                       (Wildcat 3.X or 4.X,GAP,TAG, etc)
  834.            12        SPITFIRE                        SFDOORS.DAT
  835.            13        2AM                             JUMPER.DAT
  836.            14        TRIBBS                          TRIBBS.SYS
  837.  
  838.  
  839.           BBS_TIME_LEFT: integer;                          [INF]
  840.  
  841.               This holds the amount of time that the user had left
  842.           when he entered the door. It is loaded from the DROP FILE
  843.           by INITDOORDRIVER. Note that this provides the time left
  844.           when the user ENTERED the door, not the current time left.
  845.           The current amount of time left is calculated by the
  846.           function TIME_LEFT.
  847.  
  848.           BOARD_NAME: String[70];                          [INF]
  849.  
  850.                Board_Name hold the current BBS's name that is set in
  851.           the control file.
  852.  
  853.           CHARORIGIN: CharOriginType;                      [INF]
  854.  
  855.                Returns either LocalChar or RemoteChar depending on
  856.           where the last sread_char was received from. This is
  857.           mainly used in the chat routine to set different
  858.           foreground colors for local and remote users.
  859.  
  860.           COM_PORT: byte;                                  [INF]
  861.  
  862.                Contains the current com port that serial output is
  863.           going to. Should be a zero if in local mode.
  864.  
  865.  
  866.           CURRENT_FORGROUND: byte;                         [INF]
  867.  
  868.                This variable stores the current foreground color.
  869.  
  870.  
  871.           CURRENT_BACKGROUND: byte;                        [INF]
  872.  
  873.                This variable stores the current background color.
  874.  
  875.           CURLINENUM: byte;                                [INF]
  876.  
  877.                This variable is used internally to control the more
  878.           prompt. It is incremented when a line of text is sent out.
  879.           When it reaches 24, a <more> is sent. This is of course,
  880.           providing that morechk:=true.
  881.                                                            [INF]
  882.           GRAPHICS: byte;
  883.  
  884.               Graphics specifies a text mode:
  885.  
  886.               1 : Ascii - General Text
  887.               2 : Ascii's Extended Graphics and General Text
  888.               3 : Ansi Color and Graphics
  889.               4 : Ansi Color and Graphics and Ansi Music (See
  890.                   Section on ANSI.TPU)
  891.               5:  RIP Color and Graphics
  892.          
  893.           LOCAL: boolean;                                  [INF]
  894.  
  895.               This boolean is alway true if in local mode and false
  896.           if in remote mode.
  897.  
  898.  
  899.           MINTIME: byte;                                   [INF]
  900.  
  901.                (check this - don't know)
  902.  
  903.           MORECHK: boolean;                                [CTL]
  904.  
  905.                This boolean allows you to toggle the more prompts on
  906.           or off. If TRUE, then DDPLUS will display a "more"
  907.           prompt every 24 lines.
  908.  
  909.           NODE_NUM: byte;                                  [INF]
  910.  
  911.                Returns the current Node that the door is running
  912.           under. Defaulted to 1 in a single node system. This
  913.           corresponds directly to the "/Nx" command line parameter.
  914.  
  915.  
  916.           NOTIME: String;                                  [CTL]
  917.  
  918.                (check this)
  919.  
  920.                When the users time limit has been reached this
  921.           string will be displayed then the user will be returned to
  922.           the bbs. This string has a default of "(***TIME LIMIT
  923.           EXCEEDED***)".
  924.  
  925.           STATFORE: byte;                                  [CTL]
  926.  
  927.                The status line foreground.
  928.  
  929.  
  930.           STATBACK: byte;                                  [CTL]
  931.  
  932.                The status line background.
  933.  
  934.  
  935.           STATLINE: boolean;                               [CTL]
  936.  
  937.                A status line pops while any door is in operation if
  938.           this boolean is set true. The status line contains the
  939.           user name and the program name an the users time left.
  940.  
  941.  
  942.           SYSOP_FIRST_NAME: string[30];                    [INF]
  943.  
  944.                Returns the first name of the sysop. The name is
  945.           entered into door-driver through the control file.
  946.  
  947.  
  948.           SYSOP_LAST_NAME: string[30];                     [INF]
  949.  
  950.                Returns the last name of the sysop. The name is
  951.           entered into door-driver through the control file.
  952.  
  953.  
  954.           USER_FIRST_NAME: string[30];                     [INF]
  955.  
  956.                Returns the first name of the current user of the
  957.           door program. The user's name is determined from whatever
  958.           door information is passed from the bbs software.
  959.  
  960.  
  961.           USER_LAST_NAME: string[30];                      [INF]
  962.  
  963.                Returns the last name of the current user of the door
  964.           program. The user's name is determined from whatever door
  965.           information is passed from the bbs software.
  966.  
  967.  
  968.           USER_ACCESS_LEVEL: word;                         [INF]
  969.  
  970.                Returns the access level of the user. The user's
  971.           access level is determined from whatever door information
  972.           is passed from the bbs software.
  973.  
  974.  
  975.           PROGNAME: String[60];                            [CTL]
  976.  
  977.                This option must be set by the programmer, preferably
  978.           in the beginning of the door. It sets the name that will
  979.           be displayed centered on line 25 of the screen. It is
  980.           simply used for cosmetic purposes.
  981.  
  982.           SETFORECHECK: boolean; (default=FALSE)           [CTL]
  983.  
  984.                 This variable when set to TRUE will cause DOORDRIV
  985.           to filter out repetetive SET_FOREGROUND() calls. If for
  986.           example, you set the foreground to gray, then set it to
  987.           gray again later while the foreground is still gray, the
  988.           second call would be ignored. This can spare the user from
  989.           the slowdown effects of meaningless, repetetive
  990.           SET_FOREGROUND calls.
  991.  
  992.                    Reference - Procedure Substitutions
  993.                    -----------------------------------
  994.           This section is provided to help you in figuring out which
  995.           DDPLUS routines you should call to replace turbo's
  996.           standard I/O routines.
  997.  
  998.           READKEY:
  999.  
  1000.               Readkey is used in many normal programs to get a
  1001.           single character. (i.e. CHAR:=readey). This can be
  1002.           replaced by SREAD_CHAR(char);.
  1003.  
  1004.           WRITELN(xxxx);  (or WRITE(xxxx))
  1005.  
  1006.               The writeln procedure is probably the most common and
  1007.           numerous change that you will have to make. DDPLUS
  1008.           provides the SWRITE/SWRITELN procedures to do the job of
  1009.           turbo's write/writeln. In addition, the SOUTPUT file is
  1010.           also available. Let's take a look at some examples:
  1011.  
  1012.           Ex 1
  1013.           ----
  1014.            Convert "writeln('Scott was here!');"
  1015.  
  1016.               --> swriteln('Scott was here!');
  1017.  
  1018.            or --> writeln(soutput,'Scott was here!');
  1019.  
  1020.           Ex 2
  1021.           ----
  1022.            int is an integer.
  1023.            Convert "write(int);"
  1024.  
  1025.               --> str(int,tempstr); swrite(tempstr);
  1026.  
  1027.            or --> write(soutput,int);
  1028.  
  1029.           Ex 3
  1030.           ----
  1031.            r is a real.
  1032.            Covert "writeln(r:2:2);"
  1033.  
  1034.               ---> str(r:2:2,tempstr); swriteln(tempstr);
  1035.  
  1036.            or ---> writeln(soutput,r:2:2);
  1037.  
  1038.               As you can see, the SWRITE/SWRITELN method is easier
  1039.           if you are using string type data, but the
  1040.           write(SOUTPUT,xxx) method is better for numerical types.
  1041.           You can use whichever you like.
  1042.  
  1043.  
  1044.           CLREOL:
  1045.  
  1046.               You can replace CLREOL with SCLREOL, but please note
  1047.           that it will only work when the caller has ANSI
  1048.           capabilities. If the caller doesn't have ansi, then he'll
  1049.           get a load of garbage.
  1050.  
  1051.  
  1052.           CLRSCR:
  1053.  
  1054.               CLRSCR can be directly converted to SCLRSCR. This
  1055.           works for either ANSI or non-ANSI users.
  1056.  
  1057.           GOTOXY(x,y):
  1058.  
  1059.               GOTOXY(x,y) can be converted into SGOTO_XY(x,y), but
  1060.           again, this will only work for ansi users.
  1061.  
  1062.           READLN(string_variable) ---> SREAD(string_variable)
  1063.  
  1064.           READLN(integer_variable) ---> SREAD_NUM(integer_variable)
  1065.  
  1066.           READLN(word_variable) ---> SREAD_WORD(word_variable)
  1067.  
  1068.           READLN(long_variable) ---> SREAD_LONGINT(long_variable)
  1069.  
  1070.                            REFERENCE - Units
  1071.                            -----------------
  1072.  
  1073.  The following is a brief list of the included units and what they do
  1074.  here. 
  1075.  
  1076.                *DDPLUS.PAS
  1077.  
  1078.                This is the main unit that you need to use.
  1079.  
  1080.                *DDANSI2.PAS
  1081.  
  1082.                Contains procedures used by DDPLUS to display
  1083.                ANSI on local screen.
  1084.  
  1085.                *DDFOSSIL.PAS
  1086.  
  1087.                Contains procedures used by DDPLUS to interact
  1088.                with fossil drivers.
  1089.  
  1090.                *DDSCOTT.PAS
  1091.  
  1092.                Miscellanious procedures used by DDPlus.
  1093.  
  1094.  
  1095.                *COMIO.PAS
  1096.  
  1097.                Medium-level COM I/O used by DDPlus.
  1098.  
  1099.                *ASYNC2.PAS/SLASYNC.OBJ
  1100.  
  1101.                Internal COM routines.
  1102.  
  1103.                *DVAWARE.OBJ
  1104.  
  1105.                Routines for support of Desqview
  1106.                
  1107.                *DDOVR.PAS
  1108.  
  1109.                Overlayable unit containing code that gets
  1110.                information out of bbs drop files (i.e. DORINFOx.DEF, etc)
  1111.  
  1112.                *DDOVR2.PAS
  1113.  
  1114.                Overlayable unit that contains code to process
  1115.                control file.
  1116.  
  1117.  --------------------------------------------------------------------------
  1118.  SPECIAL NOTE:  The following tutorial was originally authored by Scott
  1119.  Baker and has been modified for use with DDPlus.  The unaltered parts
  1120.  remain copyrighted by him.
  1121.  --------------------------------------------------------------------------
  1122.  
  1123.                         HOW TO WRITE A DOOR
  1124.                         -------------------
  1125.  *   Writing a BBS Door - Tutorial by Scott M. Baker
  1126.  
  1127.      Doors are programs written for a bulletin board systems
  1128.      to allow the user to perform other tasks than the bulletin
  1129.      board  software  allows.   For example,  a  door  could be
  1130.      anything  from a  bbs lister  to a  multiplayer simulation
  1131.      (such  as  Galactic Warzone,  Yankee  Trader,  Trade Wars,
  1132.      etc).  This  article will  be a  tutorial on  how to write
  1133.      door  programs.  The  programs will  be  written  in Turbo
  1134.      Pascal (version  6 or 7) and  will use  the DDPlus 
  1135.      routines to  provide support for  RBBS, QuickBBS, Wildcat,
  1136.      WWIV, etc.
  1137.  
  1138.      Right  now,  we're   just  going  to   stick  with  the
  1139.      DDPLus routines since they are  the routines that I am
  1140.      most familiar with.
  1141.  
  1142.                           REQUIREMENTS
  1143.      What you'll need:
  1144.  
  1145.      - Turbo Pascal by Borland. Either version 6.0 or
  1146.        7.0 will do.
  1147.  
  1148.      - DDPLUS71.ZIP. This is a DDPLUS support
  1149.        package for TP6 and TP7 It includes async
  1150.        support, bbs interfacing, etc. Available from
  1151.        the TANSTAFL BBS (501-741-5699) (FIDO 1:391/3010).
  1152.        If you have a 9600 baud or above modem you can freq
  1153.        it from the TANSTAFL BBS using the magic name of DDPLUS.
  1154.  
  1155.      - A basic understanding of Pascal (specifically
  1156.        Turbo   Pascal).  You   don't  need   to  be   a  Pascal
  1157.        wizard or anything, but the more knowledge you
  1158.        have, the better.
  1159.  
  1160.                    BASIC ELEMENTS OF A 'DOOR'
  1161.  
  1162.        Ok, time to  get started. First lets  talk about the basic
  1163.        elements that a door needs.
  1164.  
  1165.        1) Async communications support.
  1166.  
  1167.        The door  must be  able to  talk to  the user  through the
  1168.        communications  port.   Support  has  to  be  provided for
  1169.        multiple com ports,  locked baud rates,  etc.  The program
  1170.        also must monitor the presence of the CARRIER DETECT modem
  1171.        line to  make sure  the carrier  is not  dropped while the
  1172.        door is in use.
  1173.  
  1174.        2) BBS software interfacing.
  1175.  
  1176.        The door needs  to be able  to grab the  user's name, time
  1177.        left,  and  other  associated  information  from  the  bbs
  1178.        software.  Since bbs  programs lack standardization, there
  1179.        are several  different methods  that have  to be accounted
  1180.        for.
  1181.  
  1182.        3) Support for ANSI (color) graphics and animation.
  1183.  
  1184.        Just about every door has ANSI capabilities these    days,
  1185.        so if  you want  yours to  be seriously  considered, you'd
  1186.        better have it as well.
  1187.  
  1188.        DDPlus  will  handle  the  first  two  points  for you
  1189.        automatically when  you call  the INITDOORDRIVER procedure
  1190.        described  below.  DDPlus has  support  for  the third
  1191.        point (ANSI graphics), but you'll need to use your own
  1192.        skills  in deciding  where you  wish  to put  colors, what
  1193.        colors to use, etc.
  1194.  
  1195.  
  1196.                             DDPLUS PROCEDURES
  1197.  
  1198.        There  are a  series  of procedures  that  DDPLUS will
  1199.        provide  to you  for  accomplishing these  tasks.  Without
  1200.        getting too complex, let's discuss a few of them:
  1201.  
  1202.        PROCEDURE INITDOORDRIVER(ctl_file_name: string);
  1203.  
  1204.        This procedure  initializes the door  support system, comm
  1205.        port,  grabs  the user  name,  and a  few  other necessary
  1206.        things.    The  variable   "ctl_file_name"  is   a  string
  1207.        containing the  name of  the control  file that  your door
  1208.        will use.  For now, let's just ignore the control file and
  1209.        use the sample included with the DD package.
  1210.  
  1211.        PROCEDURE SWRITE(out_str: string);
  1212.  
  1213.        This is DDPLUS's compliment to  the Write() statement of Turbo
  1214.        Pascal.  The "S"  stands for simultaneous.  Output will be
  1215.        written to both the remote user (through the com port) and
  1216.        the local screen.  "out_str" is the  string containing the
  1217.        data  you wish  to write.   Most of  your output  will use
  1218.        either this or the following SWRITELN procedure.
  1219.  
  1220.        PROCEDURE SWRITELN(out_str: string);
  1221.  
  1222.        Same  as SWRITE,  except  a carriage  return/line  feed is
  1223.        appended to  the end  of the  string.  This  is similar to
  1224.        TP's writeln statement.
  1225.  
  1226.        variable USER_FIRST_NAME: STRING;
  1227.  
  1228.        After INITDOORDRIVER  has been called,  this variable will
  1229.        contain the  user's first  name.  The  string will  be all
  1230.        upper-case.
  1231.  
  1232.        variable USER_LAST_NAME: STRING;
  1233.  
  1234.        Similar to USER_FIRST_NAME, this variable will contain the
  1235.        user's last name.  As with USER_FIRST_NAME, it is only
  1236.        valid after the call to INITDOORDRIVER has been made.
  1237.  
  1238.                          YOUR FIRST DOOR
  1239.  
  1240.        Now  that  you've  seen  a  few  of  DDPLUS's  support
  1241.        routines, lets put them to  work in the "hello door."  The
  1242.        hello door will  be simply a door  version of the standard
  1243.        hello program.  Meaning that  it displays "hello world" to
  1244.        the screen.  First, a note  about my code, I'll be placing
  1245.        line  numbers  ({1}, {2},  etc)  in the  code.   These are
  1246.        intended for discussion purposes and are not needed in the
  1247.        pascal program itself.
  1248.  
  1249.           HLODOOR.PAS:
  1250.  
  1251.           {1} Program HelloDoor;
  1252.           {2}
  1253.           {3} uses crt, ddplus;
  1254.           {4}
  1255.           {5} begin
  1256.           {6}   InitDoorDriver('GAME.CTL');
  1257.           {7}   swriteln('Hello World!');
  1258.           {8}   delay(5000);
  1259.           {9} end.
  1260.  
  1261.           Experienced pascal programmers will feel a bit insulted by
  1262.           the simplicity of the above program, but it is a necessary
  1263.           step in learning to use door driver.
  1264.  
  1265.  
  1266.                         COMPILING AND RUNNING THE DOOR
  1267.  
  1268.  
  1269.           Once you've got  that typed in, then  it's time to compile
  1270.           HLODOOR.  Using either Turbo Pascal version 6.0 or version
  1271.           7.0, compile the program to  disk.  If all goes well, then
  1272.           you'll  be  left  with  HLODOOR.EXE  on  your  hard drive.
  1273.           DDPLUS.DOC  (supplied with  DDPLUS)  includes infor-
  1274.           mation on how to configure /  run the door on your system.
  1275.           For now, let's just worry  about running the door in local
  1276.           mode.  For local mode, type  "/L" on the command line. For
  1277.           example, "HLODOOR  /L" will run  HLODOOR. Since  you are a
  1278.           local user,  the door will  prompt you for  your first and
  1279.           last name.  A remote  user's information would be gathered
  1280.           from  the  bbs information  file  (i.e.  DORINFOx.DEF). We
  1281.           won't worry about that for now.
  1282.  
  1283.  
  1284.                                ANALYSIS OF CODE
  1285.  
  1286.  
  1287.           Now lets  go through  the important  lines of  code one by
  1288.           one.
  1289.  
  1290.               LINE 3: Uses crt, DDPlus;
  1291.  
  1292.           The "uses" statement  is required by  Turbo Pascal to tell
  1293.           TP  which  units we  will  be using.   Obviously,  we need
  1294.           "DDPLUS" for DDPLUS's procedures.  "crt" is required because
  1295.           we use the DELAY procedure.
  1296.  
  1297.               LINE 6: InitDoorDriver('Game.CTL');
  1298.  
  1299.           This  is   that  all-important   initialization  statement
  1300.           described  somewhere above.   It  tells DDPLUS  to get
  1301.           things all set up and  working.  The 'GAME.CTL' is the
  1302.           name of that "control file" and we won't pay any attention
  1303.           to it for now.
  1304.  
  1305.               LINE 7: swriteln('Hello World!');
  1306.  
  1307.           This is our  screen output.  It'll  write "Hello World" to
  1308.           both the  user and the  local screen.   Since its SWRITELN
  1309.           and not SWRITE, a carriage  return and line feed also will
  1310.           be sent.  There are several ways that this could have been
  1311.           done. For example:
  1312.  
  1313.             {1}   swrite('Hello');
  1314.             {2}   swriteln(' World!');
  1315.  
  1316.               - - - or - - -
  1317.  
  1318.             {1}   swrite('Hello');
  1319.             {2}   swrite(' World!');
  1320.             {3}   swriteln('');
  1321.  
  1322.           The output will be the same in the above situations.
  1323.  
  1324.               LINE 8: Delay(5000);
  1325.  
  1326.           This routine  is provided  by Borland  and will  cause our
  1327.           program to delay  so you can see  the "hello world" before
  1328.           DDPLUS exits and clears the screen.  The string "Hello
  1329.           World!" looks pretty  plain, doesn't it?   Maybe we should
  1330.           put something a bit more impressive in, such as the user's
  1331.           name.    This   would    involve   using   the   variables
  1332.           USER_FIRST_NAME  and USER_LAST_NAME.  The  modification is
  1333.           simple enough:
  1334.  
  1335.               Change line 7 from:
  1336.  
  1337.               {7} swriteln('Hello World!');
  1338.  
  1339.               to:
  1340.  
  1341.               {7} swriteln('Hello, '+user_first_name+' '+
  1342.                   user_last_name+'!');
  1343.  
  1344.           As you may have noticed, I  used plus signs (+) instead of
  1345.           commas  (,)  to  separate  the  string  parameters  in the
  1346.           SWRITELN line.  With a standard WRITELN statement, you may
  1347.           use as many  variables as you wish,  but with SWRITELN, we
  1348.           are  limited  to  1 string  variable.   The  point  is, TP
  1349.           requires us  to merge  our string  variables together with
  1350.           the plus sign.
  1351.  
  1352.           We will now dig deeper into some interactive communication
  1353.           with the user. The best way to do this is with a sample program.
  1354.           Our last sample, HLODOOR was pretty plain, so let's write
  1355.           something that is a bit more exciting.
  1356.  
  1357.           The following is NUMDOOR.PAS: a simple little game
  1358.           designed to demonstrate some interactive communication
  1359.           with the user.
  1360.  
  1361.           { 1} program numdoor;
  1362.           { 2}
  1363.           { 3} uses ddplus;
  1364.           { 4}
  1365.           { 5} procedure DoTheTitle;
  1366.           { 6} begin;
  1367.           { 7}  sclrscr;
  1368.           { 8}  swriteln('Hello, '+user_first_name+
  1369.           { 9}          ' '+user_last_name+
  1370.           {10}          '. Welcome to NumDoor!');
  1371.           {11}  swriteln('');
  1372.           {12} end;
  1373.           {13}
  1374.           {14} procedure playgame;
  1375.           {15} var
  1376.           {16}  thenum: word;
  1377.           {17}  playerguess: word;
  1378.           {18}  guessnum: byte;
  1379.           {19}  done: boolean;
  1380.           {20}  tempstr: string;
  1381.           {21} begin;
  1382.           {22}  swriteln('I''m thinking of a number.'+
  1383.           {23}           ' Can you guess what it is?');
  1384.           {24}  swriteln('');
  1385.           {25}  guessnum:=0;
  1386.           {26}  randomize;
  1387.           {27}  thenum:=random(100)+1;
  1388.           {28}  done:=false;
  1389.           {29}  while not done do begin;
  1390.           {30}   inc(guessnum);
  1391.           {31}   swrite('Guess #');
  1392.           {32}   str(guessnum,tempstr);
  1393.           {33}   swrite(tempstr);
  1394.           {34}   swrite(': ');
  1395.           {35}   sread_num_word(playerguess);
  1396.           {36}   if playerguess>thenum then swriteln('Lower!') else
  1397.           {37}   if playerguess<thenum then swriteln('Higher!') else
  1398.           {38}    if playerguess=thenum then begin;
  1399.           {39}     swriteln('Correct!');
  1400.           {40}     done:=true;
  1401.           {41}    end;
  1402.           {42}   if guessnum=10 then done:=true;
  1403.           {43}  end; {while}
  1404.           {44}  if thenum<>playerguess then begin;
  1405.           {45}   swriteln('You Lost!');
  1406.           {46}   str(thenum,tempstr);
  1407.           {47}   swriteln('The number was '+tempstr+'.');
  1408.           {48}  end;
  1409.           {49} end;
  1410.           {50}
  1411.           {51} procedure waitforkey;
  1412.           {52} var
  1413.           {53}  ch: char;
  1414.           {54} begin;
  1415.           {55}  swriteln('');
  1416.           {56}  swriteln('Press any key to continue.');
  1417.           {57}  sread_char(ch);
  1418.           {58} end;
  1419.           {59}
  1420.           {60} begin;
  1421.           {61}  initdoordriver('GAME.CTL');
  1422.           {62}  dothetitle;
  1423.           {63}  playgame;
  1424.           {64}  waitforkey
  1425.           {65} end.
  1426.  
  1427.               Some of you were asking for a real door.. Well, there
  1428.           it is. All 62 lines worth.
  1429.  
  1430.               First lets look at an overview of the structure of
  1431.           NUMDOOR. We've got three main procedures: DoTheTitle,
  1432.           PlayGame, and WaitForKey. These procedures are pretty self
  1433.           explanatory. DoTheTitle displays a little title
  1434.           information about NUMDOOR. PlayGame performs the actual
  1435.           task of playing the game, and WaitForKey waits for the
  1436.           user to press a key once the game is over.
  1437.  
  1438.               Let's go through the program section by section. At
  1439.           the very top, you'll notice lines one and three. Line 1
  1440.           (Program NumDoor;) is simply us formally telling TP the
  1441.           name of our program. Line 2 (Uses DDPLUS;) is the
  1442.           all-important "uses" statement which tells TP that we will
  1443.           be using the DDPLUS TPU.
  1444.  
  1445.                              Procedure DoTheTitle
  1446.  
  1447.               The first procedure, DoTheTitle displays a little
  1448.           introduction to the user so he knows where he is. Let's
  1449.           look inside this procedure and see how it works:
  1450.  
  1451.               LINE 7: SCLRSCR;
  1452.  
  1453.               This is a DDPLUS procedure which we have not
  1454.           introduced before. Sclrscr is DDPLUS's compliment to
  1455.           the Turbo Pascal clrscr procedure. The clrscr procedure is
  1456.           provided by TP to allow us to clear the screen. If you're
  1457.           familiar with basic, then this is equivalent to a CLS.
  1458.           Obviously, we will need to clear both the remote and the
  1459.           local screens, so that's why we have to use DDPLUS's
  1460.           Sclrscr.
  1461.  
  1462.               LINES 8-10: SWRITELN('Hello, '+user_first_name+ .....
  1463.  
  1464.               These lines display the introduction. As we learned in
  1465.           part one of this tutorial, SWRITELN is DDPLUS's
  1466.           compliment to Turbo Pascal's writeln procedure. You may
  1467.           notice that I have separated the parameters across three
  1468.           lines. This is perfectly legal - as long as the individual
  1469.           components include plus (+) signs in between them, we can
  1470.           split it up that way.
  1471.               Another important note about this line: We include the
  1472.           variables USER_FIRST_NAME and USER_LAST_NAME. These were
  1473.           discussed in part one. For those who may have missed it,
  1474.           DDPLUS places the user's first and last names into
  1475.           those two respective variables. Sticking them in the
  1476.           SWRITELN allows us to be a bit more personal to the user.
  1477.  
  1478.               LINE 11: SWRITELN('');
  1479.  
  1480.               You may be wondering, what is the point of writing
  1481.           _nothing_ to the screen? The point is, like TP's writeln,
  1482.           swriteln will output a CR/LF sequence. So even if we do
  1483.           not write any data, the Carriage Return still goes out.
  1484.           The effect is a blank line.
  1485.  
  1486.                               Procedure PlayGame
  1487.  
  1488.               PlayGame is where all of the real work takes place.
  1489.           Let's take a minute to talk about what exactly the "game"
  1490.           is that we are playing.
  1491.               The game is a very common number guessing game. The
  1492.           computer generates a random number and the user gets ten
  1493.           shots to guess what it is. If the user guesses
  1494.           incorrectly, the computer will tell whether he needs to go
  1495.           "higher" or "lower". Now that we know what we want to do,
  1496.           lets see how we would go about doing it. In pseudocode,
  1497.           here's what we need to do:
  1498.  
  1499.               1) Generate a random number
  1500.               2) Ask the user for a guess
  1501.               3) Compare the user's guess to our random number.
  1502.               4) Say "lower", "higher", or "correct" based on the
  1503.                  outcome of #3's comparison.
  1504.               5) Loop back to 2 until either the user guesses the
  1505.                  number correctly or uses up all ten tries.
  1506.               6) If the user used up all ten tries, tell him he
  1507.                  lost.
  1508.  
  1509.               That's our strategy. Now, let's go thought the actual
  1510.           code.
  1511.  
  1512.               LINES 16-20: Variable Declarations
  1513.  
  1514.               We need a multitude of variables to store some of our
  1515.           information in. THENUM is a word variable which will hold
  1516.           the random number which we generate. PLAYERGUESS is
  1517.           another word to hold the player's current guess. GUESSNUM
  1518.           is a counter to hold how many times the user has guessed.
  1519.           DONE is a boolean to tell us when we are done. And
  1520.           finally, TEMPSTR is a temporary string which we will
  1521.           discuss when we come to it.
  1522.  
  1523.               LINES 22-24: SWRITELN('I''m thinking of .....
  1524.  
  1525.               These lines comprise a little instruction that we give
  1526.           the user. They're just simple swriteln statements, similar
  1527.           to the ones we encountered in DoTheTitle.
  1528.  
  1529.               LINE 25: GUESSNUM:=0;
  1530.  
  1531.               Since Turbo Pascal does not initialize our variables,
  1532.           we will have to do it ourselves. Guessnum is our counter
  1533.           of how many guesses the user has made. Since he hasn't
  1534.           made any yet, we've got to set it to zero.
  1535.  
  1536.               LINE 26: RANDOMIZE;
  1537.  
  1538.               The Randomize procedure is provided by Turbo Pascal to
  1539.           randomize TP's random number generator. Without it, the
  1540.           game would pick the same random number each time it runs.
  1541.  
  1542.               LINE 27: THENUM:=RANDOM(100)+1
  1543.  
  1544.               Here is where we get our random number. The random
  1545.           function returns a number between zero and it's parameter
  1546.           minus one. (i.e. Random(100) will include 0..99, not 100)
  1547.           So we add 1 to it to get numbers between 1 and 100.
  1548.  
  1549.               LINE 28: DONE:=FALSE;
  1550.  
  1551.               Right now, we aren't done yet, (we haven't even hardly
  1552.           started!) so we'd better set our variable accordingly.
  1553.  
  1554.               LINE 29: WHILE NOT DONE DO BEGIN;
  1555.  
  1556.               Line 29 sets up our "loop" which will ask the user for
  1557.           up to ten guesses. We want to keep going as long as DONE
  1558.           is not true. The loop consists of lines 29-43 which ask
  1559.           the user for his guess and check it's validity.
  1560.  
  1561.               LINE 30: INC(GUESSNUM);
  1562.  
  1563.               We're on the first guess, so set guessnum accordingly.
  1564.  
  1565.               LINES 31-34: SWRITE('Guess #' .....
  1566.  
  1567.               These lines prompt the user for his guess. Although
  1568.           they may seem complicated, they are really nothing more
  1569.           than the simple SWRITE statements that we have seen
  1570.           before. We just need to do some "magic" to manipulate our
  1571.           data.
  1572.               Let me explain our problem: SWRITE/SWRITELN only
  1573.           accept string data. But, our variable GUESSNUM is a byte
  1574.           variable which holds numeric information. So how do we get
  1575.           this data into something we can use? The answer is that we
  1576.           use Turbo Pascal's STR procedure. STR is a very handy
  1577.           procedure which converts a numeric format variable to a
  1578.           string format variable. So, when we say
  1579.           STR(GUESSNUM,TEMPSTR), we are telling pascal to "take the
  1580.           number in guessnum, convert it to a string, and place it
  1581.           in tempstr".
  1582.               Once this has been done, TEMPSTR now contains our
  1583.           number which we can send out to swrite with no problem.
  1584.  
  1585.               LINE 35: SREAD_NUM_WORD(PLAYERGUESS);
  1586.  
  1587.               This line the major new concept that we are trying to
  1588.           introduce. SREAD_NUM_WORD is a DDPLUS procedure which
  1589.           will read a word variable from the user. It handles all
  1590.           the details of waiting for the user to press keys,
  1591.           converting the data to a word, etc and just gives us a
  1592.           nice word variable.
  1593.               This is where the "interaction" takes place. Until
  1594.           now, we have just been displaying information to the user.
  1595.           Now, we ask the user for some information back.
  1596.           Specifically, we ask him for his guess. The guess is
  1597.           stored in the variable PLAYERGUESS.
  1598.  
  1599.               LINES 36-41: If playerguess>thenum then ....
  1600.  
  1601.               This block comprises the code to test the player's
  1602.           guess and act upon the results. We display "higher" or
  1603.           "lower" if the number is higher or lower and if the user's
  1604.           guess is correct, we display "correct" and set DONE to
  1605.           true to end our loop.
  1606.               This code is all standard pascal stuff (with some
  1607.           swrites thrown) in so I won't go into too much detail
  1608.           here. We've got to try to stick to the DDPLUS-related
  1609.           things or our little tutorial could get very big very
  1610.           quickly.
  1611.  
  1612.               LINE 42: IF GUESSNUM=10 THEN DONE:=TRUE;
  1613.  
  1614.               If we're at the tenth guess, then it's time to end our
  1615.           loop.
  1616.  
  1617.               LINES 44-48: IF PLAYERGUSS<>THENUM THEN BEGIN; ....
  1618.  
  1619.               We could have exited the loop for one of two reasons:
  1620.           1) The user guessed correctly and DONE was set to true or
  1621.           2) The user ran out of turns. These lines will check and
  1622.           see if the user's guess was correct. If it was not, then
  1623.           we got to break the bad news to him - he lost.
  1624.               This code also includes our little trick of using STR
  1625.           to convert the data. In this case, we have THENUM and we
  1626.           need to convert it to a string so we can tell the user
  1627.           what the number was. It works identically to the situation
  1628.           we had in lines 31-34.
  1629.  
  1630.                              Procedure WaitForKey
  1631.  
  1632.               After we have finished PlayGame, we need to have a
  1633.           little pause so the user gets to absorb the full impact of
  1634.           his game playing. We could use a simple DELAY(2000) for a
  1635.           20 second delay, but we are out to demonstrate interactive
  1636.           communication, so let's wait for a keypress.
  1637.               I'm not going into this line-by-line as it is such a
  1638.           simple procedure. Rather, I'll describe what it does.
  1639.           First, we tell the user we want him to hit a key with a
  1640.           SWRITELN statement.
  1641.               Then, we use DDPLUS's SREAD_CHAR procedure to read
  1642.           a single character. SREAD_CHAR will wait for a key and
  1643.           then return it to us. We used the variable CH to hold this
  1644.           character.
  1645.  
  1646.                               The Main Procedure
  1647.  
  1648.               The main procedure, comprising lines 60-65 executes
  1649.           all of our other procedure. Please note that similar to
  1650.           HLODOOR, we had to call INITDOORDRIVER() to get DDPLUS
  1651.           setup and ready for use.
  1652.               After that, we just called DoTheTitle, PlayGame, and
  1653.           WaitForKey in order. Then, we exit.
  1654.  
  1655.                              Interactive Routines
  1656.  
  1657.               We have introduced two new very important routines:
  1658.           SREAD_NUM_WORD and SREAD_CHAR. DDPLUS includes a whole
  1659.           set of similar routines for doing similar things. Here's a
  1660.           listing of them:
  1661.  
  1662.               SREAD(s: string);              Reads in a string
  1663.  
  1664.               SREAD_NUM(i: integer);         Reads in an integer
  1665.  
  1666.               SREAD_NUM_WORD(w: word);       Reads in a word
  1667.  
  1668.               SREAD_NUM_LONGINT(l: longint); Reads in a longint
  1669.  
  1670.               SREAD_CHAR(CH: CHAR);          Reads in a char
  1671.  
  1672.               The first four of these routines will read in data
  1673.           until the user presses the return key. For example
  1674.           "1234"<return>. They allow the user to backspace back and
  1675.           forth to correct his mistakes. These are very similar to
  1676.           Turbo Pascal's READLN and Basic's INPUT statements.
  1677.               The fifth procedure (SREAD_CHAR) will wait for a
  1678.           character and return that character. It's simply for when
  1679.           you want one character and only one character. The user
  1680.           can't correct his mistakes with backspace or anything.
  1681.           This routine also does not echo to the screen.
  1682.               SREAD_CHAR performs almost identically to Turbo
  1683.           Pascal's READKEY function. In Turbo Pascal you would use
  1684.           ch:=READKEY; With DDPLUS, use SREAD_CHAR(CH).
  1685.  
  1686.           REFERENCE - IMPORTANT THINGS
  1687.           ----------------------------
  1688.  
  1689.           -> What happens when the user runs out of time, sleep
  1690.           -> disconnects, or drops carrier?
  1691.  
  1692.           DDPLUS will HALT. This will cause an immediate
  1693.           termination of the door. If your door needs to save any
  1694.           data then you should use an EXIT PROCEDURE to save the
  1695.           data. For example:
  1696.  
  1697.           {$F+} procedure myexit; {$F-}
  1698.           begin;
  1699.            save_our_data;
  1700.            exitproc:=exitsave;
  1701.           end;
  1702.  
  1703.           {main program}
  1704.           begin;
  1705.            InitDoorDriver......
  1706.            ExitSave:=Exitproc;
  1707.            ExitProc:=@myexit;
  1708.            .......
  1709.           end.
  1710.  
  1711.           This will setup MYEXIT so it is run whenever your program
  1712.           exits for any reason. This is the best way to trapped
  1713.           carrier dropped, out of time, etc.
  1714.  
  1715.           NOTE #1: The carrier, time left, and sleep disconnect are
  1716.           only tested when DDPLUS is waiting for a keypress
  1717.           (i.e. sread_char, sread, etc)
  1718.  
  1719.           NOTE #2: If checktime=false then DDPLUS will not check
  1720.           to see if the user is out of time.
  1721.  
  1722.           -> How do you use ANSI in your programs?
  1723.  
  1724.           You can use ANSI by two methods:
  1725.  
  1726.            1) By using the set_foreground, set_background, and
  1727.               sclrscr procedures, you can perform some basic ANSI
  1728.               functions. DDPLUS will automatically enable these
  1729.               fucntions when ANSI is available and disable it when
  1730.               not.
  1731.  
  1732.            2) If you set ANSION:=TRUE, then you can just SWRITE your
  1733.               ansi sequences directly to the screen. When you turn
  1734.               ANSION on, it will slow down screen writes, so it is
  1735.               advisable to do it only when necessary.
  1736.  
  1737.  --------------------------------------------------------------------------
  1738.  This ends the copyrighted Scott Baker part of the documentation.
  1739.  The rest of this document is from Steven Lorenz and Bob Dalton.
  1740.  --------------------------------------------------------------------------
  1741.                                    
  1742.                               CREDITS:
  1743.                               --------
  1744.  This relatively small section is just to recognize the people who have made
  1745.  the DDPLUS package a possibility.
  1746.  
  1747.  Scott Baker       -=*=-  The authors of the original DoorDriver Kit
  1748.  and                       are to be thanked for releasing the
  1749.  Derrick Parkhurst         source code to their great kit!  Without
  1750.                            that act of kindness DDPLUS would NOT
  1751.                            be possible.  Hopefully Steve and I
  1752.                            have done your kit justice and given it
  1753.                            a new lease on life in the programming
  1754.                            world. Scott is the author of several
  1755.                            door games, most notably Land of Devastation,
  1756.                            which uses the original doordriver kit.
  1757.  
  1758.  Steven Lorenz      -=*=- The author of the enhanced add on package
  1759.                            to Scott Bakers DoorDriver Kit. Thanks to
  1760.                            his code modifications, add ons and enhancements
  1761.                            DDPLus is a much more complete and capable
  1762.                            package then originally released in the
  1763.                            DoorDriver Kit. He is also responsible for
  1764.                            the DDPlus setup program which he freely donated.
  1765.                            Steve is the author of several door games, most
  1766.                            notably Railroad Empires, Romans At War, and
  1767.                            Empires at War, all of which use DDPlus.
  1768.  
  1769.  Bob Dalton         -=*=- The author of most of the documentation in this
  1770.                            package and contributor of the OVERLAY.ZIP,
  1771.                            LOCKING.ZIP, ELOG.ZIP and many other items in
  1772.                            this kit. Bob is the author of several door
  1773.                            games, such as GodFather of Crime, Rise To
  1774.                            Power, Task Force Broadside, Ship of the Line,
  1775.                            Grunt Fest, Way Freight and the Adventure Door
  1776.                            Game Toolkit, all of which use DDPLus.
  1777.  
  1778.  Andy Stewart       -=*=- The author of the IBBS.ZIP portion of the
  1779.                            DDPLUS kit. Great job Andy!
  1780.  
  1781.  Tom Morgan         -=*=- The author of the RIPLINK.ZIP portion of DDPLUS
  1782.                            for deciding to make his RipLink package
  1783.                            freeware and include it in the DDPLus kit. 
  1784.  
  1785.  DESQview is a registered trademark of Quarterdeck Office Systems.
  1786.  Ripscript & Ripterm are registered trademarks of TeleGrafix Communications.
  1787.  
  1788.                            Where to reach us
  1789.                            -----------------
  1790.  
  1791.  We can usually be reached at the following places:      
  1792.  
  1793.  Steven Lorenz - The Officer Club BBS - Telephone Number: 818-249-8579 (CA)
  1794.  
  1795.  Bob Dalton    - The TANSTAFL BBS - Telephone Number: 501-741-5699 (AR).
  1796.                  FIDO Node Number: 1:391/3010
  1797.  
  1798.  Scott Baker   - Although he NO longer supports his original DoorDriver
  1799.                   kit I am sure he would appreciate any free program you
  1800.                   were to offer him. He can be reached at his Not Yet Named
  1801.                   BBS at 602-544-4655 (AZ) or FIDO Node Number 1:300/9. Keep
  1802.                   in mind he will NOT answer any questions about this kit!
  1803.  
  1804.  NOTE:  Both Steve Lorenz and Bob Dalton habitually monitor the FIDO door
  1805.          related National and International echos if you have questions.
  1806.          Bob Dalton also monitors the Pascal FIDO echo as well. Address
  1807.          ALL questions about DDPlus to either Steve or Bob and no one
  1808.          else, assuming you want an answer that is.  Since this package
  1809.          is FREEWARE, please do not expect us to send you a reply back at
  1810.          our expense, either call back for it or poll us via FIDO 48 hours
  1811.          after you netmailed the question.
  1812.  
  1813.                    Bug Reports/Comments/Suggestions
  1814.                    --------------------------------
  1815.  We have made every attempt to make sure this package is free of bugs, BUT
  1816.  the possibility always exists that one may have been missed by us. 
  1817.  If you find a bug, or have a suggestion or comment to make which would make
  1818.  future versions of DDPlus even better, then netmail Bob Dalton or post a
  1819.  message on one of our BBS's. We do read ALL of them and those people that
  1820.  lead us to find a bug or generate a better package will receive credit in
  1821.  the next DDPlus version published. PLEASE DO NOT NOTIFY US OF PROBLEMS AND
  1822.  EXPECT US TO FIX THEM IF YOU HAVE FAILED TO PROVIDE US WITH COMPLETE
  1823.  SPECIFIC INFORMATION ON THE PROBLEM!  
  1824.  
  1825.                           FIDO INFORMATION
  1826.                           ----------------
  1827.  Bob Dalton's BBS supports file "freq"ing at 9600 baud or above. Just call
  1828.  1:391/3010. He also carries a door library of over 400 of the all time best
  1829.  door games which he tries to keep current.  For a list of these doors just
  1830.  freq "DOORS". We are always adding new things to DDPlus so most likely
  1831.  there will be a later version of the program available on one of our BBS's
  1832.  then the one you have. For a current version of DDPLUS you can call
  1833.  either Steve's or Bob's BBS and download it, or if you are a member of
  1834.  the FIDO network and have a 9600 baud or above modem you can freq the
  1835.  magic name "DDPLUS" for the latest version.  Bob Dalton carries a large
  1836.  Turbo Pascal support file section. If you would like a list of these files
  1837.  just freq "FILES" from him. If you are a door game/program writer
  1838.  why not send Bob or Steve a copy of your game/program?  If you have a more
  1839.  current version of a door then we have, please consider sending us a copy
  1840.  as a token of your appreciation for the service we offer at NO cost to you.
  1841.  Thanks!